package cn.sinata.wanglin.adapter;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;
import java.util.ArrayList;
import cn.sinata.wanglin.village.fragment.ActiveFragment;
import cn.sinata.wanglin.village.fragment.MakecomplaintsFragment;
/**
 * description：
 * Created by kaihongwu on 2016/12/13 下午 3:32
 */
public class CelldynameicesPagerAdapter extends FragmentStatePagerAdapter {
    private  ArrayList<String> mdatas;
    public CelldynameicesPagerAdapter(FragmentManager fm, ArrayList<String> mdatas) {
        super(fm);
        this.mdatas=mdatas;
    }

    @Override
    public Fragment getItem(int position) {
        switch (position)
        {
            case 0:
                return MakecomplaintsFragment.newInstance();
            case 1:
                return ActiveFragment.newInstance();

        }
        return new Fragment();
    }

    @Override
    public int getCount() {
        return mdatas.size();
    }
    @Override
    public CharSequence getPageTitle(int position) {
        return mdatas.get(position);
    }

    @Override
    public int getItemPosition(Object object) {
        return POSITION_NONE;
    }
}
